import { TGuildStructureTimeConfig } from "../../../Message/Db/Tables/TGuildStructureTimeConfig";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
//class GuildStructureAccConfig
    
    export  class GuildStructureAccConfig
    {
        constructor()
        {
            
            this._array = [];
            if (GuildStructureAccConfig._instance != null) 
            {
                throw new Error(" GuildStructureAccConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TGuildStructureTimeConfig();
                loc1.id = loc2.id;
                loc1.time = loc2.time;
                loc1.propNum = loc2.propNum;
                loc1.goldNum = loc2.goldNum;
                loc1.desc = StringHelper.getString(loc2.desc);
                this._array.push(loc1);
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_guild_structure_time_config.json");
            this.write(loc1);
            return;
        }

        public getConfigArray(): Array<any>
        {
            return this._array;
        }

        public static get instance(): GuildStructureAccConfig
        {
            if (GuildStructureAccConfig._instance == null) 
            {
                GuildStructureAccConfig._instance = new GuildStructureAccConfig();
            }
            return GuildStructureAccConfig._instance;
        }

        /* internal */ /* var */_array: Array<any>;

        /* internal */ static /* var */_instance: GuildStructureAccConfig;
    }
